package com.grape.dp.strategy.controller;

import com.grape.dp.strategy.context.PayContextStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述:PayController
 * @author: myx
 * @date: 2019-07-21
 * Copyright © 2019-grape. All rights reserved.
 */
@RestController
public class PayController {
    @Autowired
    private PayContextStrategy payContextStrategy;
    @RequestMapping("/toPayHtml")
    public  String toPayHtml(String payCode){
        if(StringUtils.isEmpty(payCode)){
            return "渠道code不能为空!";
        }
        return payContextStrategy.toPayHtml(payCode);
    }
}
